package com.hgyc.mom.qms.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hgyc.mom.common.vo.Result;
import com.hgyc.mom.core.mybatis.QueryWrapperUtil;
import com.hgyc.mom.qms.entity.QmsInspectionTerminalItem;
import com.hgyc.mom.qms.service.QmsInspectionTerminalItemService;
import com.hgyc.mom.qms.vo.TerminalItemVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 检测终端不良采集项目 Controller
 *
 * @author fwj
 * @since 2025-07-02
 */
@Tag(name = "检测终端不良采集项目 控制器", description = "检测终端不良采集项目 控制器")
@RestController
@RequestMapping("/qms/terminal/item")
public class QmsInspectionTerminalItemController {
    @Autowired
    private QmsInspectionTerminalItemService qmsInspectionTerminalItemService;

    @Operation(summary = "查询检测终端不良采集项目", description = "查询检测终端不良采集项目")
    @GetMapping("/list/{terminalId}")
    public Result<List<TerminalItemVO>> pageList(@PathVariable("terminalId") Long terminalId) {
        List<TerminalItemVO> list = qmsInspectionTerminalItemService.getByTerminalId(terminalId);
        return Result.success(list);
    }

    @Operation(summary = "获取检测终端不良采集项目 详细信息", description = "获取检测终端不良采集项目 详细信息")
    @GetMapping(value = "/{recordId}")
    public Result<?> getInfo(@Parameter(description = "检测终端不良采集项目 ID") @PathVariable("recordId") Long recordId) {
        return Result.success(qmsInspectionTerminalItemService.getById(recordId));
    }


}
